package com.ficus.road.maintain.dao.coverage;

import com.ficus.road.maintain.core.dao.BaseMongoDao;
import com.ficus.road.maintain.core.model.coverage.UnitCoverageWeek;
import org.springframework.data.domain.Sort;
import org.springframework.data.mongodb.core.index.Index;
import org.springframework.stereotype.Component;

/**
 * @author xiawen yang
 * @date 2022/3/15 下午2:19
 */
@Component
public class UnitCoverageWeekDao extends BaseMongoDao<UnitCoverageWeek, String> {
    @Override
    public String getCollectionName() {
        return "coverage_unit_week";
    }

    @Override
    protected void indexOperation() {
        super.getMongoTemplate().indexOps(getCollectionName()).ensureIndex(new Index().on("cycle_num", Sort.Direction.DESC).background());
    }
}
